import logging

import uvicorn
from . import logger, utils
from .interface import app

LOG = logging.getLogger(__name__)


def run_app(host='127.0.0.1', port=8000, log_name=None):
    log_name = log_name or "{}-ocr.log".format(utils.get_now_day())
    logger.set_logging(log_name)
    uvicorn.run(app, host=host, port=int(port))
